package com.bigdata.hive;

import com.bigdata.commom.PropConstant;
import com.common.utils.PropertiesUtils;

/**
 * @author xin.ding
 * @date 2020/10/27 16:05
 */
public class Hive {
    public static void main(String[] args) {
        HiveConfig config = new HiveConfig();
        config.setUrl(PropertiesUtils.getString(PropConstant.HIVE_URL));
        config.setUsername(PropertiesUtils.getString(PropConstant.HIVE_USER));
        config.setPassword(PropertiesUtils.getString(PropConstant.HIVE_PASSWORD));
        config.setKerberos(PropertiesUtils.getBoolean(PropConstant.HIVE_KERBEROS));
        config.setKrb5File(PropertiesUtils.getString(PropConstant.HIVE_KRB5_PATH));
        config.setPrincipal(PropertiesUtils.getString(PropConstant.HIVE_PRINCIPAL));
        config.setKeytabFile(PropertiesUtils.getString(PropConstant.HIVE_KEYTAB));

        HiveDao hiveDao = new HiveDao(config);
        System.out.println("Hive连接信息：" + hiveDao.getConnection());
        System.out.println(hiveDao.showDatabases());
    }
}
